You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Honor explicit nlsEnabled=false in NVIDIADriver helm template - #3215
templates/nvidiadriver.yaml rendered licensingConfig.nlsEnabled with | default true. Sprig's default treats false as empty, so an explicit driver.licensingConfig.nlsEnabled=false was always rendered as true.
This switches both the secretName and configMapName branches to hasKey, so true is only used when the value is not set at all.
Checklist
No secrets, sensitive information, or unrelated changes
The reason will be displayed to describe this comment to others. Learn more.
🟡 Empty licensing override breaks driver upgrades
With an empty nlsEnabled override, hasKey renders a blank value instead of the previous true. The NVIDIADriver CRD requires a boolean, so Helm cannot apply the resource.
Learn more
The chart accepts Helm overrides for licensing settings. Helm's --set-string driver.licensingConfig.nlsEnabled= leaves a present key with an empty string, so hasKey takes the value branch and produces nlsEnabled: with a null YAML value. The NVIDIADriver schema requires a boolean. The previous default true treated the empty string as missing and produced valid YAML. Both licensing source branches use the same new expression.
Example: An install with driver.licensingConfig.secretName=license and driver.licensingConfig.nlsEnabled= rendered nlsEnabled: true before this change. On upgrade it renders nlsEnabled: and Kubernetes rejects the NVIDIADriver.
Recommended fix: Preserve false explicitly while treating empty or null overrides as unset in both branches; add render checks for false and empty values.
Was this helpful? React with 👍 or 👎 to provide feedback.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Licensing fix lacks a regression test
Both nlsEnabled branches change behavior without a regression test. Automated checks cannot catch a return to rendering explicit false as true.
Learn more
This bug fix changes rendering in both licensing source branches, but the PR contains no new test. Testing conventions explicitly require a regression test that fails without a bug fix, and the chart is the supported installation path.
Example: If either branch reverts to default true, an explicit nlsEnabled=false silently becomes true again; a Helm rendering test that asserts the output for both sources would fail.
Recommended fix: Add automated rendering checks for secretName and configMapName, each with explicit false and default true, and wire them into the repository's test workflow.
Was this helpful? React with 👍 or 👎 to provide feedback.
Both licensing configuration branches in the NVIDIADriver template now preserve an explicitly configured nlsEnabled value, including false. When the key is absent, the template renders true.
Severity of issue fixed: Low
Merge Risk: Low · up to a29a1
The licensing fix is mergeable with follow-up; regression tests would guard against restoring the incorrect value.
Architecture risk: Low · up to a29a1
The change affects 1 system.
Changed systems:deployments
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — deployments (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in deployments/gpu-operator/templates/nvidiadriver.yaml: Both the secret-based and ConfigMap-based licensingConfig branches now use hasKey to preserve an explicitly configured nlsEnabled value, including false, and render true only when the key is absent. Previously, both branches used default true.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
76-76: Minor · Maintainability & Code Quality · Quick win
Add regression tests for both licensing sources.
The PR reports no new test cases. Add rendering tests that set nlsEnabled: false with each of secretName and configMapName. Both tests should fail with the previous default true expression.
Based on learnings, “When fixing a bug, add a regression test that fails without the fix.”
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
The 'default' function treats false as empty, so setting
driver.licensingConfig.nlsEnabled=false always rendered true. Use
hasKey so true is only applied when the value is not set.
Signed-off-by: Ajax-1 <85230126+Ajax-1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #3211
Description
templates/nvidiadriver.yamlrenderedlicensingConfig.nlsEnabledwith| default true. Sprig'sdefaulttreatsfalseas empty, so an explicitdriver.licensingConfig.nlsEnabled=falsewas always rendered astrue.This switches both the
secretNameandconfigMapNamebranches tohasKey, sotrueis only used when the value is not set at all.Checklist
make lint)make validate-generated-assets)make validate-modules)Testing
The chart has no template test harness, so I checked the rendered output with
helm template:Before:
After:
=null)helm lint deployments/gpu-operatorpasses.